﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyShopCD.GUI
{
    public partial class frm_QLCD : Form
    {
        public frm_QLCD()
        {
            InitializeComponent();
        }
        QuanLyShopCD.BL.cl_QLCD clCD;
        private void frm_QLCD_Load(object sender, EventArgs e)
        {
            clCD = new QuanLyShopCD.BL.cl_QLCD(this);
            clCD.Hienthi(null);
            clCD.ComboBox();
        }
        private void bt_them_Click(object sender, EventArgs e)
        {
            clCD = new QuanLyShopCD.BL.cl_QLCD(this);
            clCD.Them();
            dataGridView1.Refresh();
        }

        private void bt_sua_Click(object sender, EventArgs e)
        {
            clCD = new QuanLyShopCD.BL.cl_QLCD(this);
            clCD.Sua();
            dataGridView1.Refresh();
        }

        private void bt_xoa_Click(object sender, EventArgs e)
        {
            string macd = txt_macd1.Text;
            clCD = new QuanLyShopCD.BL.cl_QLCD(this);
            DialogResult result;
            result = MessageBox.Show("Ban Co Muon Xoa CD Co MaCD = '" + macd + "' nay Khong! ", "MT", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (result == DialogResult.OK)
                clCD.Xoa(macd);
        }

        private void bt_thoat_Click(object sender, EventArgs e)
        {
            DialogResult result;
            result = MessageBox.Show("ban co muon thoat form nay khong!", "MT", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (result == DialogResult.OK)
                this.Close();
        }


    }
}
